package com.ruoyi.passenger.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.passenger.mapper.VehicleFenceMapper;
import com.ruoyi.passenger.domain.VehicleFence;
import com.ruoyi.passenger.service.IVehicleFenceService;

/**
 * 电子围栏Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-20
 */
@Service
public class VehicleFenceServiceImpl implements IVehicleFenceService 
{
    @Autowired
    private VehicleFenceMapper vehicleFenceMapper;

    /**
     * 查询电子围栏
     * 
     * @param id 电子围栏主键
     * @return 电子围栏
     */
    @Override
    public VehicleFence selectVehicleFenceById(Long id)
    {
        return vehicleFenceMapper.selectVehicleFenceById(id);
    }

    /**
     * 查询电子围栏列表
     * 
     * @param vehicleFence 电子围栏
     * @return 电子围栏
     */
    @Override
    public List<VehicleFence> selectVehicleFenceList(VehicleFence vehicleFence)
    {
        return vehicleFenceMapper.selectVehicleFenceList(vehicleFence);
    }

    /**
     * 新增电子围栏
     * 
     * @param vehicleFence 电子围栏
     * @return 结果
     */
    @Override
    public int insertVehicleFence(VehicleFence vehicleFence)
    {
        vehicleFence.setCreateTime(DateUtils.getNowDate());
        return vehicleFenceMapper.insertVehicleFence(vehicleFence);
    }

    /**
     * 修改电子围栏
     * 
     * @param vehicleFence 电子围栏
     * @return 结果
     */
    @Override
    public int updateVehicleFence(VehicleFence vehicleFence)
    {
        vehicleFence.setUpdateTime(DateUtils.getNowDate());
        return vehicleFenceMapper.updateVehicleFence(vehicleFence);
    }

    /**
     * 批量删除电子围栏
     * 
     * @param ids 需要删除的电子围栏主键
     * @return 结果
     */
    @Override
    public int deleteVehicleFenceByIds(Long[] ids)
    {
        return vehicleFenceMapper.deleteVehicleFenceByIds(ids);
    }

    /**
     * 删除电子围栏信息
     * 
     * @param id 电子围栏主键
     * @return 结果
     */
    @Override
    public int deleteVehicleFenceById(Long id)
    {
        return vehicleFenceMapper.deleteVehicleFenceById(id);
    }
}
